1. Field of the Invention
The invention generally relates to computer systems. In particular, the invention relates to caching in a computer system.
2. Description of the Related Art
Audio compression and video compression techniques have made it practical to send media presentations over a digital network, such as over the Internet. In addition to media clips, a computer server can be used to serve a variety of other types of information, such as advertisements, news articles, database files, software upgrades, and the like, to a user.
Typically, the data for the files is stored in a source of mass storage, such as in hard disks, redundant arrays of inexpensive disks (RAID), optical disks, and the like. However, mass storage devices are typically relatively slow, and thus data is often cached in relatively fast solid state memory, such as random access memory (“RAM” or “memory”). Examples of memory include static RAM (SRAM) and dynamic RAM (DRAM). With caching, a portion of the data stored in mass storage is copied to and retrieved from the memory cache (“cache”).
Despite advances in compression technology, such as MPEG-4 video compression technology, media data files remain relatively large in size. In addition, a server system, such as a media server, typically stores data for a vast number of media presentations, such as video clips and music clips. In relatively low-cost systems, it can be impractical to provide a cache that is as large as the amount of data stored in the mass storage, i.e., the cache is typically smaller than the mass storage. Thus, the data that is requested is not always present in the cache.
A cache “hit” occurs when the data is available from the cache, and the system retrieves the data from the relatively fast cache rather than from the relatively slow mass storage. A cache “miss” occurs when the data is not available from the cache, and the system retrieves the data from the mass storage. It will be understood that a system can be configured to retrieve data for a cache miss directly from the mass storage or from the mass storage via a read of the mass storage by a cache controller.
Conventional techniques of cache management are inadequate. The relatively low “hit” rate of existing cache systems results in frequent paging of data to the cache, relatively high latency due to waiting for data to be read from the mass storage, and relatively high CPU usage to manage the cache misses. Conventional cache management techniques provide a relatively low cache hit rate for selected types of files, such as for MPEG-4 files, and fail to exploit the full potential of the cache.